package com.frog.framework.ms.api.dto;


public class PageDomain {

    /** 当前记录起始索引 */
    private Integer pageNum;

    /** 每页显示记录数 */
    private Integer pageSize;

    /**
     * 排序字段
     */
    private String orderByField;

    /**
     * 排序方向
     */
    private String orderByOrient;


    public String getOrderBy() {
        if (orderByField == null || orderByField.trim().length() == 0) {
            return "";
        }
        orderByOrient = orderByOrient == null || orderByOrient.trim() == "" ? "asc" : orderByOrient;
        return orderByField + " " + orderByOrient;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public String getOrderByField() {
        return orderByField;
    }

    public void setOrderByField(String orderByField) {
        this.orderByField = orderByField;
    }

    public String getOrderByOrient() {
        return orderByOrient;
    }

    public void setOrderByOrient(String orderByOrient) {
        this.orderByOrient = orderByOrient;
    }
}
